const express = require('express');
const router = express.Router();
const { upload } = require('../middleware/upload');
const { uploadFile, getFiles, getFileVersions, deleteFile } = require('../controllers/fileController');

// 上传Excel文件
router.post('/upload', upload.single('file'), uploadFile);

// 获取所有文件列表
router.get('/files', getFiles);

// 获取特定文件的版本列表
router.get('/files/:fileId/versions', getFileVersions);

// 删除文件
router.delete('/files/:fileId', deleteFile);

module.exports = router;